﻿using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace MYData.Entity.DTO.ApiEntity.Input
{
    /// <summary>
    /// 项目经费模板输入DTO
    /// </summary>
    public class ProjectFundingTemplateInput_Dto
    {
        /// <summary>
        ///经费模板名称
        /// </summary>
        [Display(Name = "经费模板名称")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string fundtemplateName { get; set; }

        /// <summary>
        ///经费模板状态 0代表已启用1为未启用
        /// </summary>
        [Display(Name = "经费模板状态 0代表已启用1为未启用")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int fundtemplateState { get; set; }

        /// <summary>
        ///经费模板预算转换率
        /// </summary>
        [Display(Name = "经费模板预算转换率")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int fundtemplateFunsRatio { get; set; }

        /// <summary>
        ///经费模板预算转换率单位
        /// </summary>
        [Display(Name = "经费模板预算转换率单位")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string fundtemplateFunsRatioName { get; set; }

        /// <summary>
        ///是否包含配套经费 
        /// </summary>
        [Display(Name = "是否包含配套经费 ")]
        [Column(TypeName = "bool")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public bool isSupportingFunds { get; set; }

        /// <summary>
        /// 项目来源
        /// </summary>
        public FundingTemplateSource_relation_Dto? Source { get; set; }

    }

    public class FundingTemplateSource_relation_Dto
    {
        /// <summary>
        ///模板Id
        /// </summary>
        [Display(Name = "模板Id")]
        [MaxLength(64)]
        [Column(TypeName = "nvarchar(64)")]
        [Editable(true)]
        public string templateId { get; set; }

        /// <summary>
        ///项目来源单位ID
        /// </summary>
        [Display(Name = "项目来源单位ID")]
        [MaxLength(64)]
        [Column(TypeName = "nvarchar(64)")]
        [Editable(true)]
        public string sourcePartId { get; set; }
    }

    public class UpdateTemplateSource_Dto:ProjectFundingTemplateInput_Dto
    {
        /// <summary>
        ///经费模板主表Id
        /// </summary>
        [Display(Name = "经费模板主表Id")]
        [MaxLength(64)]
        [Column(TypeName = "nvarchar(64)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string fundtemplateId { get; set; }
    }
}
